{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "8\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from scipy import integrate\n",
    "import scipy as sp\n",
    "\n",
    "from matplotlib import pyplot as plt\n",
    "\n",
    "import os\n",
    "import multiprocessing\n",
    "from joblib import Parallel, delayed\n",
    "num_cores = multiprocessing.cpu_count()\n",
    "print(num_cores)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "#physical constant\n",
    "B_field = 6.\n",
    "EC = 56.1*np.sqrt(B_field)           #in meV (using epsilon=1, the coulomb energy in vacuum)\n",
    "lB = 25.66/np.sqrt(B_field)          #Magnetic length in nm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "def J0_integral(rV, q, tol=1e-15, d = 1, dr = np.inf, full_output=False):\n",
    "\t\t\"\"\"MPZ: Integrates  Vq = 2 \\\\pi \\\\int_0^\\\\inf  J_0(q r) rV(r) dr.\n",
    "\t\t\t\trV is a callable function, with domain [0, +inf) and range in float.\n",
    "\t\t\t\tq is a float\n",
    "\t\t\t\ttol = Desired absolute error\n",
    "\t\t\t\td = Length scale at which any r-->0 singularities may occur\n",
    "\t\t\t\tdr = Optional; length scale beyond which rV(r) is negligible. Can be important to know when 1 >> dr q\n",
    "\t\t\t\tfull_output is a Boolean: then return number of periods integrated and #func evaluations\n",
    "\n",
    "\t\t\tReturns\n",
    "\t\t\t\tif full_output is False:\n",
    "\t\t\t\t\tVq\n",
    "\t\t\t\tif full_output is True:\n",
    "\t\t\t\t\tVq, number of periods integrated, number of function evaluation\n",
    "\n",
    "\t\t\tExample:\n",
    "\t\t\t\t>>>\tq = 2.\n",
    "\t\t\t\t>>>\tprint mod.mQHfunc.J0_integral(lambda r: np.exp(-r), q)\n",
    "\t\t\t\t>>>\tprint 2 * np.pi / np.sqrt(q**2 + 1)\n",
    "\t\t\t\t\t2.80992589242\n",
    "\t\t\t\t\t2.80992589242\n",
    "\t\n",
    "\t\t\tStrategy:\n",
    "\t\t\t1)\tIntegrate in subintervals [r_j, r_{j+1}], defined by r_j = pi (j + 3/4) / q .\n",
    "\t\t\t\t\tThe r_j's are the approximate zeros of J_0(q r),\n",
    "\t\t\t2)\tTabulate the partial sums, and Euler sum them to accelerate convergence.\n",
    "\t\t\t\t\n",
    "\t\t\t\t\n",
    "\t\t\"\"\"\n",
    "\t\ttwo_pi = 2. * np.pi\n",
    "\t\t\n",
    "\t\tdef euler_sum(S):\n",
    "\t\t\t#Euler summation given partial sums S\n",
    "\t\t\tN = len(S) - 1\n",
    "\t\t\tbinom = [ sp.special.comb(N, n, exact = True) for n in range(N+1) ]\t\t# binomial coef\n",
    "\t\t\treturn np.inner(S, binom) / 2**N\n",
    "\t\t\t#return np.inner(S, sp.stats.binom.pmf(range(N+1),N, 0.5))\n",
    "\t\tdef I(r):\n",
    "\t\t\t#The integrand\n",
    "\t\t\treturn sp.special.j0(q*r)*rV(r)\n",
    "\t\n",
    "\t\tn_Eval = 0\t\t# number of rV() evaluations\n",
    "\t\tn_Quad = 0\n",
    "\t\tstatus = 'converged'\n",
    "\t\tif q==0.:\n",
    "\t\t\t#Break out near singular behaviour near 0\n",
    "\t\t\ta0, abserr, infodict = sp.integrate.quad(rV, 0., d, epsabs=tol/50., full_output = True)[:3]\n",
    "\t\t\tn_Eval+=infodict['neval']\n",
    "\n",
    "\t\t\ta1, abserr, infodict = sp.integrate.quad(rV, d, np.inf, epsabs=tol/50., full_output = True)[:3]\n",
    "\t\t\tn_Eval+=infodict['neval']\n",
    "\t\t\tn_Quad+=2\n",
    "\t\t\tif full_output:\n",
    "\t\t\t\treturn (a0+a1) * two_pi, {'n_quad':n_Quad, 'n_eval':n_eval, 'converged':True}\n",
    "\t\t\telse:\n",
    "\t\t\t\treturn (a0+a1) * two_pi\n",
    "\t\t\t\n",
    "\t\t#Seperate out first interval, [0, r_0], and garauntee subdivision for accuracy\n",
    "\t\tbreak_pt = min(0.375*np.pi/q, d)\n",
    "\t\tif np.pi*0.75/q < dr:\n",
    "\t\t\tbreak_pt = min(0.375*np.pi/q, d)\n",
    "\t\t\ta0, abserr, infodict =  sp.integrate.quad(I, 0., np.pi*0.75/q, epsabs=tol/50., full_output = True, points = [break_pt])[:3]\n",
    "\t\t\tn_Eval+=infodict['neval']\n",
    "\t\t\tn_Quad+=1\n",
    "\t\telse:\n",
    "\t\t\tbreak_pt = min(dr/2., d)\n",
    "\t\t\ta0, abserr, infodict =  sp.integrate.quad(I, 0., dr, epsabs=tol/50., full_output = True, points = [break_pt])[:3]\n",
    "\t\t\tn_Eval+=infodict['neval']\n",
    "\t\t\ta1, abserr, infodict =  sp.integrate.quad(I, dr, np.pi*0.75/q, epsabs=tol/50., full_output = True)[:3]\n",
    "\t\t\tn_Eval+=infodict['neval']\n",
    "\t\t\tn_Quad+=2\n",
    "\t\t\ta0+=a1\n",
    "\t\ta0 *= two_pi\n",
    "\t\t\n",
    "\t\t#Initialize S, ES\n",
    "\t\tr, abserr, infodict = sp.integrate.quad(I, np.pi*0.75/q, np.pi*1.75/q, full_output = True)[:3]\n",
    "\t\tr *= two_pi\n",
    "\t\tn_Eval+=infodict['neval']\n",
    "\t\tn_Quad+=1\n",
    "\t\tS = [r] #partial sums\n",
    "\t\tES = [r] #euler sums\n",
    "\t\t\n",
    "\t\tj = 1.75\n",
    "\t\twhile j < 50:\n",
    "\t\t\tr, abserr, infodict = sp.integrate.quad(I, np.pi*j/q, np.pi*(j+1.)/q, full_output = True)[:3]\n",
    "\t\t\tr *= two_pi\n",
    "\t\t\tn_Eval+=infodict['neval']\n",
    "\t\t\tn_Quad+=1\n",
    "\t\t\tS.append( S[-1] + r )\n",
    "\t\t\t\n",
    "\t\t\tif abs(r) < max(abserr, tol): #Forget Euler summation - absolute convergence!\n",
    "\t\t\t\tif full_output:\n",
    "\t\t\t\t\treturn S[-1] + a0, {'n_quad':n_Quad, 'n_eval':n_eval, 'converged':True}\n",
    "\t\t\t\telse:\n",
    "\t\t\t\t\treturn S[-1] + a0\n",
    "\t\t\tES.append(euler_sum(S))\n",
    "\t\t\n",
    "\t\t\tif\tabs(ES[-1] - ES[-2]) < max(abserr, tol): #Good enough - our work is done.\n",
    "\t\t\t\tif full_output:\n",
    "\t\t\t\t\treturn ES[-1] + a0, {'n_quad':n_Quad, 'n_eval':n_eval, 'converged':True}\n",
    "\t\t\t\treturn ES[-1] + a0\n",
    "\t\t\t\n",
    "\t\t\tj+=1.\n",
    "\t\n",
    "\t\tprint(\"\\tJ0_integral: Poorly behaved integrand!  q = {}, d = {}, tol = {}, n_Quad = {}, n_Eval = {}, \".format(q, d, tol, n_Quad, n_Eval))\n",
    "\t\tprint(\"\\t\\tS - S[-1]:\", np.array(S) - S[-1])\n",
    "\t\tprint(\"\\t\\tES - ES[-1]:\", np.array(ES) - ES[-1])\n",
    "\t\tif full_output:\n",
    "\t\t\treturn ES[-1] + a0, {'n_quad':n_Quad, 'n_eval':n_eval, 'converged':False, 'dS':np.array(S) - S[-1], 'dES':np.array(ES) - ES[-1]}\n",
    "\t\telse:\n",
    "\t\t\treturn ES[-1] + a0\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "impurity C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "# these potential data is extracted from raw data using dataPrep_impurityBC_multi_filling.m\n",
    "# one side of the line cut\n",
    "df = pd.read_csv(r'multi_filling_lineC.csv')\n",
    "# the other sido of the line cut\n",
    "df2 = pd.read_csv(r'multi_filling_lineC2.csv')\n",
    "\n",
    "# remove data too far from the core\n",
    "r_range = 102\n",
    "to_pop = [c for c in df.columns if (c.replace('.','0').isnumeric() and float(c)>r_range) ]\n",
    "for c in to_pop: \n",
    "    df.pop(c)\n",
    "to_pop2 = [c for c in df2.columns if (c.replace('.','0').isnumeric() and float(c)>r_range) ]\n",
    "for c in to_pop2: \n",
    "    df2.pop(c)\n",
    "\n",
    "nu = np.asarray(df['filling_factor'])                   #np array of filling factor\n",
    "label = list(map(str,nu))                               #np array of string of filling factor\n",
    "\n",
    "r = df.columns[2:].to_numpy().astype(float) / lB    #np array in magnetic length\n",
    "r_range = r_range / lB\n",
    "\n",
    "n_r , n_nu = (r.shape[0],nu.shape[0])                   #number of r point, filling factor\n",
    "n_q = n_r*2\n",
    "\n",
    "q = np.linspace(0,10,n_q)\n",
    "q_range = q.max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "#create callalbe function for J0_integral\n",
    "class r_intep():\n",
    "    def __init__(self,data):\n",
    "        self.tmp_f = data\n",
    "    def rf(self,r_query):\n",
    "        if r_query > r_range: return 0\n",
    "        else: return r_query*np.interp(r_query , r.tolist() , self.tmp_f.tolist())\n",
    "\n",
    "class q_intep():\n",
    "    def __init__(self,data):\n",
    "        self.tmp_f = data\n",
    "    def qf(self,q_query):\n",
    "        if q_query > q_range: return 0\n",
    "        else: return q_query*np.interp(q_query , q.tolist() , self.tmp_f.tolist())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1902968540.py:28: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n"
     ]
    }
   ],
   "source": [
    "phi_r_total = []\n",
    "phi_r_total_func = []\n",
    "mu = []\n",
    "\n",
    "#this is for \\phi_{impurity}(r)\n",
    "for i in range(n_nu):\n",
    "    # average line cut +r and -r\n",
    "    tmp = (df.iloc[i,2:].to_numpy() + df2.iloc[i,2:].to_numpy())*1000 / EC /2\n",
    "    phi_r_total.append(tmp)         #.reshape(-1, 1)\n",
    "\n",
    "#calculate mu, assuming total trapped charge is 1\n",
    "mu = [ (phi_r_total[i]*r).sum()/r.sum() for i in range(n_nu)]\n",
    "\n",
    "#substract mu\n",
    "phi_r_total = []\n",
    "for i in range(n_nu):\n",
    "    tmp = (df.iloc[i,2:].to_numpy() + df2.iloc[i,2:].to_numpy())*1000 / EC /2\n",
    "    # mu.append(np.mean(tmp[-20:]))\n",
    "    tmp = tmp-mu[i]\n",
    "    phi_r_total.append(tmp)         #.reshape(-1, 1)\n",
    "\n",
    "\n",
    "phi_r_total_filt = [sp.ndimage.gaussian_filter1d(phi_r_total[i],(2/(lB*r[1]))) for i in range(n_nu)]\n",
    "df_r = pd.DataFrame()\n",
    "df_r['gate(V)'] = df['gate (V)']\n",
    "df_r['filling_factor'] = df['filling_factor']\n",
    "for i in range(n_r):\n",
    "    df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
    "df_r.to_csv(r'multi_filling_lineC_r.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1957533034.py:18: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n"
     ]
    }
   ],
   "source": [
    "#reduce size effect\n",
    "filter_sizeEffect = np.array([1/(1+np.exp(1*(ir-r_range*0.8))) for ir in r])\n",
    "phi_r_total = [phi_r_total[i]*filter_sizeEffect for i in range(n_nu)]\n",
    "\n",
    "phi_r_total_func = [r_intep(phi_r_total[id]) for id in range(n_nu)]\n",
    "\n",
    "run_phi_q_total = lambda ind: np.array([J0_integral(phi_r_total_func[ind].rf, iq,\\\n",
    "                                                    tol=1e-15, d = 1, dr = r_range,\\\n",
    "                                                    full_output=False) for iq in q])\n",
    "\n",
    "phi_q_total = Parallel(n_jobs=num_cores)(delayed(run_phi_q_total)(i) for i in range(n_nu))\n",
    "\n",
    "\n",
    "df_q = pd.DataFrame()\n",
    "df_q['gate(V)'] = df['gate (V)']\n",
    "df_q['filling_factor'] = df['filling_factor']\n",
    "for i in range(n_q):\n",
    "    df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
    "df_q.to_csv(r'multi_filling_lineC_q.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "impurity B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "# these potential data is extracted from raw data using dataPrep_impurityBC_multi_filling.m\n",
    "df = pd.read_csv(r'multi_filling_lineB.csv')\n",
    "\n",
    "# remove data too far from the core\n",
    "r_range = 130\n",
    "to_pop = [c for c in df.columns if (c.replace('.','0').isnumeric() and float(c)>r_range) ]\n",
    "for c in to_pop: \n",
    "    df.pop(c)\n",
    "\n",
    "nu = np.asarray(df['filling_factor'])                   #np array of filling factor\n",
    "label = list(map(str,nu))                               #np array of string of filling factor\n",
    "\n",
    "r = df.columns[2:].to_numpy().astype(float) / lB    #np array in magnetic length\n",
    "r_range = r_range / lB\n",
    "\n",
    "n_r , n_nu = (r.shape[0],nu.shape[0])                   #number of r point, filling factor\n",
    "n_q = n_r\n",
    "\n",
    "q = np.linspace(0,10,n_q)\n",
    "q_range = q.max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/81259326.py:25: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n"
     ]
    }
   ],
   "source": [
    "phi_r_total = []\n",
    "phi_r_total_func = []\n",
    "mu = []\n",
    "\n",
    "#this is for \\phi_{impurity}(r)\n",
    "for i in range(n_nu):\n",
    "    tmp = df.iloc[i,2:].to_numpy()*1000 / EC\n",
    "    phi_r_total.append(tmp)         #.reshape(-1, 1)\n",
    "\n",
    "#calculate mu, assuming total trapped charge is 1\n",
    "mu = [ (phi_r_total[i]*r).sum()/r.sum() for i in range(n_nu)]\n",
    "\n",
    "#substract mu\n",
    "phi_r_total = []\n",
    "for i in range(n_nu):\n",
    "    tmp = df.iloc[i,2:].to_numpy()*1000 / EC\n",
    "    tmp = tmp-mu[i]\n",
    "    phi_r_total.append(tmp)         #.reshape(-1, 1)\n",
    "\n",
    "phi_r_total_filt = [sp.ndimage.gaussian_filter1d(phi_r_total[i],(2/(lB*r[1]))) for i in range(n_nu)]\n",
    "df_r = pd.DataFrame()\n",
    "df_r['gate(V)'] = df['gate (V)']\n",
    "df_r['filling_factor'] = df['filling_factor']\n",
    "for i in range(n_r):\n",
    "    df_r[r[i]] = [phi_r_total_filt[j][i] for j in range(n_nu)]\n",
    "df_r.to_csv(r'multi_filling_lineB_r.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
      "/var/folders/kt/vk9vwcbn3bb38r4przbls8zm0000gp/T/ipykernel_23913/1609479588.py:17: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n"
     ]
    }
   ],
   "source": [
    "#reduce size effect\n",
    "filter_sizeEffect = np.array([1/(1+np.exp(1*(ir-r_range*0.8))) for ir in r])\n",
    "phi_r_total = [phi_r_total[i]*filter_sizeEffect for i in range(n_nu)]\n",
    "\n",
    "phi_r_total_func = [r_intep(phi_r_total[id]) for id in range(n_nu)]\n",
    "\n",
    "run_phi_q_total = lambda ind: np.array([J0_integral(phi_r_total_func[ind].rf, iq,\\\n",
    "                                                    tol=1e-15, d = 1, dr = r_range,\\\n",
    "                                                    full_output=False) for iq in q])\n",
    "\n",
    "phi_q_total = Parallel(n_jobs=num_cores)(delayed(run_phi_q_total)(i) for i in range(n_nu))\n",
    "\n",
    "df_q = pd.DataFrame()\n",
    "df_q['gate(V)'] = df['gate (V)']\n",
    "df_q['filling_factor'] = df['filling_factor']\n",
    "for i in range(n_q):\n",
    "    df_q[q[i]] = [phi_q_total[j][i] for j in range(n_nu)]\n",
    "df_q.to_csv(r'multi_filling_lineB_q.csv')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Princeton",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
